<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=7" />
<link href="__ROOT__/statics/admin/css/style.css" rel="stylesheet" type="text/css"/>
<link href="__ROOT__/statics/css/dialog.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript" src="__ROOT__/statics/js/jquery/jquery-1.4.2.min.js"></script>
<script language="javascript" type="text/javascript" src="__ROOT__/statics/admin/js/admin_common.js"></script>
<script language="javascript" type="text/javascript" src="__ROOT__/statics/js/dialog.js"></script>
<script language="javascript" type="text/javascript" src="__ROOT__/statics/js/jquery/plugins/formvalidator.js" charset="UTF-8"></script>
<script language="javascript" type="text/javascript" src="__ROOT__/statics/js/jquery/plugins/formvalidatorregex.js" charset="UTF-8"></script>
<script language="javascript">
var URL = '__URL__';
var ROOT_PATH = '__ROOT__';
var APP	 =	 '__APP__';
var lang_please_select = "<?php echo (L("please_select")); ?>";
</script>
<title><?php echo (L("website_manage")); ?></title>
</head>

<body>
<?php if(($sub_menu != '') OR ($big_menu != '')): ?><div class="subnav">
    <div class="content-menu ib-a blue line-x">
    	<?php if(!empty($big_menu)): ?><a class="add fb" href="<?php echo ($big_menu["0"]); ?>"><em><?php echo ($big_menu["1"]); ?></em></a>　<?php endif; ?>
        <?php if(!empty($sub_menu)): ?><?php if(is_array($sub_menu)): $key = 0; $__LIST__ = $sub_menu;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$val): ++$key;$mod = ($key % 2 )?><?php if($key != '1'): ?><span>|</span><?php endif; ?>
        <a href="<?php echo u($val['c'].'/'.$val['a'], array('menuid'=>$val['id']));?>" <?php if($curr_menuid == $val['id']): ?>class="on"<?php endif; ?>><em><?php echo ($val["title"]); ?></em></a><?php endforeach; endif; else: echo "" ;endif; ?><?php endif; ?>
    </div>
</div><?php endif; ?>

<script type="text/javascript" src="__ROOT__/statics/js/kindeditor/kindeditor-min.js"></script>
<script type="text/javascript">
	//编辑器
	KE.show({
		id : 'detail',
		//imageUploadJson : 'index.php?m=attachment&a=keupload',
		//fileManagerJson : 'index.php?m=attachment&a=file_manager&',
		allowFileManager : true,
		afterCreate : function(id) {
			KE.event.ctrl(document, 13, function() {
				KE.util.setData(id);
				document.forms['myform'].submit();
			});
			KE.event.ctrl(KE.g[id].iframeDoc, 13, function() {
				KE.util.setData(id);
				document.forms['myform'].submit();
			});
		}
	});
</script>
<form action="<?php echo u('goods/insert');?>" method="post" name="myform" id="myform" enctype="multipart/form-data" >
<div class="pad-10">
<div class="col-tab">
<ul class="tabBut cu-li">
	<li id="tab_setting_1" class="on" onclick="SwapTab('setting','on','',3,1);"><?php echo (L("general_info")); ?></li>
    <li id="tab_setting_2" onclick="SwapTab('setting','on','',3,2);"><?php echo (L("goods_detail")); ?></li>
	<li id="tab_setting_3" onclick="SwapTab('setting','on','',3,3);"><?php echo (L("goods_seo")); ?></li>
</ul>

<div id="div_setting_1" class="contentList pad-10">
<table width="100%" cellpadding="2" cellspacing="1" class="table_form">
	<tr> 
      <th width="100"><?php echo (L("goods_name")); ?> :</th>
      <td><input type="text" name="name" id="name" class="input-text" size="60"></td>
    </tr>
    <tr> 
      <th><?php echo (L("goods_sn")); ?> :</th>
      <td><input type="text" name="goods_sn" id="goods_sn" class="input-text"></td>
      </tr>
    <tr> 
      <th><?php echo (L("goods_cate")); ?> :</th>
      <td>
        <select name="cate_id">
        	<?php if(is_array($cate_list['parent'])): $i = 0; $__LIST__ = $cate_list['parent'];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$val): ++$i;$mod = ($i % 2 )?><option value="<?php echo ($val["cate_id"]); ?>"><?php echo ($val["cate_name"]); ?></option>
            	<?php if(is_array($cate_list['sub'][$val['cate_id']])): $i = 0; $__LIST__ = $cate_list['sub'][$val['cate_id']];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$sval): ++$i;$mod = ($i % 2 )?><option value="<?php echo ($sval["cate_id"]); ?>">&nbsp;&nbsp;&nbsp;&nbsp;<?php echo ($sval["cate_name"]); ?></option><?php endforeach; endif; else: echo "" ;endif; ?><?php endforeach; endif; else: echo "" ;endif; ?>
        </select> 
      </td>
    </tr>
    <tr> 
      <th><?php echo (L("goods_brand")); ?> :</th>
      <td>
        <select name="brand_id">
          	<?php if(is_array($brand_list)): $i = 0; $__LIST__ = $brand_list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$val): ++$i;$mod = ($i % 2 )?><option value="<?php echo ($val["id"]); ?>"><?php echo ($val["name"]); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
        </select> 
      </td>
      </tr>
    <tr> 
      <th><?php echo (L("shop_price")); ?> :</th>
      <td><input type="text" name="sprice" id="sprice" class="input-text"></td>
      </tr>
    <tr> 
      <th><?php echo (L("market_price")); ?> :</th>
      <td><input type="text" name="mprice" id="mprice" class="input-text"></td>
      </tr>
    <tr> 
      <th><?php echo (L("goods_stock")); ?> :</th>
      <td><input type="text" name="stock" id="stock" class="input-text"></td>
    </tr>
    <tr> 
      <th><?php echo (L("goods_image")); ?> :</th>
      <td><input name="image" id="image" type="file" /></td>
    </tr>
</table>
</div>
<div id="div_setting_2" class="contentList pad-10 hidden">
<table width="100%" cellpadding="2" cellspacing="1" class="table_form">
	<tr> 
      <td><textarea name="detail" id="detail" style="width:80%;height:350px;visibility:hidden;"></textarea></td>
    </tr>
</table>
</div>
<div id="div_setting_3" class="contentList pad-10 hidden">
<table width="100%" cellpadding="2" cellspacing="1" class="table_form">
	<tr>
      <th width="100"><?php echo (L("seo_title")); ?> :</th>
      <td><input type="text" name="seo_title" id="seo_title" class="input-text" size="60"></td>
    </tr>
    <tr>
      <th><?php echo (L("seo_keys")); ?> :</th>
      <td><input type="text" name="seo_keys" id="seo_keys" class="input-text" size="60"></td>
    </tr>
    <tr>
      <th><?php echo (L("seo_desc")); ?> :</th>
      <td><textarea name="seo_desc" id="seo_desc" cols="80" rows="8"></textarea></td>
    </tr>
</table>
</div>

<div class="bk15"></div>
<div class="btn"><input type="submit" value="<?php echo (L("submit")); ?>" name="dosubmit" class="button" id="dosubmit"></div>
</div>
</div>
</form>
<script type="text/javascript">
function SwapTab(name,cls_show,cls_hide,cnt,cur){
    for(i=1;i<=cnt;i++){
		if(i==cur){
			 $('#div_'+name+'_'+i).show();
			 $('#tab_'+name+'_'+i).attr('class',cls_show);
		}else{
			 $('#div_'+name+'_'+i).hide();
			 $('#tab_'+name+'_'+i).attr('class',cls_hide);
		}
	}
}
</script>
</body>
</html>